#ifndef TRANSSERVICE_H
#define TRANSSERVICE_H

#include <Windows.h>
#include "CommonHdr.h"
#include "Log.h"

class TransService
{
public:
	static TransService& Instance();

	bool BeginService(DWORD,int);

	void StopService();

	void SetNotifyWindow(HWND wnd);

private:
	static unsigned int __stdcall ListenProc(void*);

	static unsigned int __stdcall WorkProc(void*);

	TransService(){}

	TransService(const TransService &)
	{
		throw std::exception("TransService class do not allow copy operation.");
	}

	~TransService();

	TransService& operator=(const TransService &)
	{
		throw std::exception("TransService class do not allow copy operation.");
	}

	bool StartListen(DWORD,u_short);

	bool StartWork();

	static log4cplus::Logger log;

	static TransService* m_instance;

	static unsigned int m_resourceInUse;
};

#endif